package com.wuyan.locationdog.adapter

import android.graphics.Color
import androidx.annotation.LayoutRes
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wuyan.locationdog.R
import com.arcsoft.commonbase.bean.TrackTimeBean
import leifu.shapelibrary.ShapeView


class TrackTimeListAdapter(@LayoutRes layoutResId: Int, data: MutableList<TrackTimeBean>?) :
    BaseQuickAdapter<TrackTimeBean, BaseViewHolder>(layoutResId, data) {


    override fun convert(holder: BaseViewHolder, item: TrackTimeBean) {
        holder.apply {
            val shapeView = getView<ShapeView>(R.id.time)
            shapeView.setText(item.time)
            if (item.isSelect) {
                shapeView.setShapeStrokeColor(Color.parseColor("#6E4DF3"))
                    .setShapeSolidColor(Color.parseColor("#E8EFFF"))
                    .setUseShape()
                shapeView.setTextColor(Color.parseColor("#6E4DF3"))

            } else {
                shapeView.setShapeStrokeColor(Color.parseColor("#DCDEE0"))
                    .setShapeSolidColor(Color.parseColor("#FFFFFF"))
                    .setUseShape()
                shapeView.setTextColor(Color.parseColor("#666666"))

            }
        }
    }
}


